package de.justphil.tcg.tcgserver.game.states;

import de.justphil.tcg.tcgserver.game.GameManager;
import de.justphil.tcg.tcgserver.game.helpers.GameHelper;
import de.justphil.tcg.tcgserver.websockets.TCGWebSocket;
import de.justphil.tcg.tcgserver.websockets.messages.TCGMessage;

abstract public class GameState {
	//private static final Logger log = logger(GameState.class);
	
	public final void gameProgress(GameManager gameManager, TCGWebSocket socket, TCGMessage msg, String data) {
		progress(gameManager, socket, msg, data);
		GameHelper.commitGameChange(gameManager);
	}
	
	abstract protected void progress(GameManager game, TCGWebSocket socket, TCGMessage msg, String data);

	@Override
	public String toString() {
		return this.getClass().getSimpleName();
	}
	
	
}
